const {mysql} = require('../qcloud')
module.exports = async (ctx) => {
    const top = await mysql('books')
                .select('id','title','image','count')
                .orderBy('count','desc')
                .limit(9)
    try {
        ctx.state = {
            code: '00',
            data: {
                list: top,
                msg: '操作成功'
            }
        }
    } catch (e) {
        ctx.state = {
            code: '02',
            data: {
                msg: '服务爸爸已经炸了'
            }
        }
    }
}